﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace NHibernateToSQLMapping.Comm
{
    public class FileDeliver
    {
        /// <summary>
        /// 写文件
        /// </summary>
        /// <param name="path"></param>
        /// <param name="contents"></param>
        public void CreateFile(string path, string contents)
        {
            if (!Directory.Exists(path.Substring(0, path.LastIndexOf("\\"))))
            {
                Directory.CreateDirectory(path.Substring(0, path.LastIndexOf("\\")));
            }
            File.WriteAllText(path, contents, Encoding.UTF8);
        }
    }
}
